#include "app_mqtt.h"
#include "log.h"
#include "unistd.h"

static int test_callback(char *payload)
{
    log_info("recv: %s", payload);
    return 0;
}
int main(int argc, char const *argv[])
{
    // 1.初始化MQTT
    app_mqtt_init();
    // 2.注册回调
    app_mqtt_recv_callback(test_callback);
    // 3.发送消息
    app_mqtt_publish("hello world");

    sleep(10);
    app_mqtt_destroy();

    return 0;
}
